{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">团队奖金</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">


    {{# if(d.is_send==0){ }}
    <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('ckuan')}','确认发送吗？')" class="layui-btn layui-btn-xs layui-btn-normal" title="确认发送">确认发送</a>
    {{# } }}



    <a class="layui-btn layui-btn-xs layui-btn-warm" data-open='{:url("detail")}?id={{ d.id }}'
       data-title="查看详情">查看详情</a>

</script>
{/block}
{block name="script"}
<script>
    layui.use(['yznTable', 'table'], function () {
        var table = layui.yznTable;
        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: "{:url('add')}",
            edit_url: "{:url('edit')}",
            delete_url: "{:url('del')}",
        };
        table.render({
            elem: '#currentTable',
            autoWidth: true,
            toolbar: ['refresh',],
            url: '{:url("index")}?status={$status}',
            init: init,
            cols: [
                [
                    {type: 'checkbox', fixed: 'left'},
                    {field: 'id', align: 'center', width: '8%', title: 'ID'},
                    {field: 'nickname', align: 'center', width: '10%', title: '用户名称',search: false},
                    {field: 'money', align: 'center', width: '15%', title: '奖金金额', search: false},
                    {field: 'time', align: 'center', width: '15%', title: '奖金月份', search: false},
                    {field: 'performance', align: 'center', width: '15%', title: '团队营业额', search: false},
                    {field: 'team_num', align: 'center', width: '15%', title: '团队人数', search: false},
                    // {
                    //     field: 'is_send', align: 'center', width: '10%', title: '是否发放', templet: function (d) {
                    //         if (d.is_send == 1) {
                    //             return '<span style="color: green">已发放</span>';
                    //         } else {
                    //             return '<span style="color: red">未发放</span>';
                    //         }
                    //     }, selectList: {0: '未发放', 1: '已发放'}
                    // },
                    {field: 'create_time', align: 'center', width: '15%', title: '生成时间', search: 'range'},
                    // {fixed: 'right', align: 'center', width: '15%', title: '操作', toolbar: '#barTool'}//delete'
                ]
            ],
            page: {}
        });
        table.bindevent();
        selectElement2 = document.getElementById('searchFieldset_currentTable');
        selectElement2.classList.remove("layui-hide");
        var element = document.getElementById('layui-input-search');
        element.parentNode.removeChild(element);
    });
</script>
{/block}